From: Niels De Graef Date: Tue, 25 Dec 2018 14:42:47 +0000 (+0100) Subject: plugin: Use G_DECLARE_FINAL_TYPE X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~888^2^2~42 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a4c159ecad744ac4a47a50df7a19591341605119;p=gnome-shell.git plugin: Use G_DECLARE_FINAL_TYPE libmutter-4 added support for this, so we can also drop the boilerplate. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/315 --- diff --git a/src/gnome-shell-plugin.c b/src/gnome-shell-plugin.c index 72cac519d..63890c2f9 100644 --- a/src/gnome-shell-plugin.c +++ b/src/gnome-shell-plugin.c @@ -47,15 +47,10 @@ #include "shell-perf-log.h" #include "shell-wm-private.h" -#define GNOME_TYPE_SHELL_PLUGIN (gnome_shell_plugin_get_type ()) -#define GNOME_SHELL_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_SHELL_PLUGIN, GnomeShellPlugin)) -#define GNOME_SHELL_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_TYPE_SHELL_PLUGIN, GnomeShellPluginClass)) -#define GNOME_IS_SHELL_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_SHELL_PLUGIN_TYPE)) -#define GNOME_IS_SHELL_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_SHELL_PLUGIN)) -#define GNOME_SHELL_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_TYPE_SHELL_PLUGIN, GnomeShellPluginClass)) - -typedef struct _GnomeShellPlugin GnomeShellPlugin; -typedef struct _GnomeShellPluginClass GnomeShellPluginClass; +#define GNOME_TYPE_SHELL_PLUGIN (gnome_shell_plugin_get_type ()) +G_DECLARE_FINAL_TYPE (GnomeShellPlugin, gnome_shell_plugin, + GNOME, SHELL_PLUGIN, + MetaPlugin) struct _GnomeShellPlugin { @@ -69,13 +64,6 @@ struct _GnomeShellPlugin ShellGlobal *global; }; -struct _GnomeShellPluginClass -{ - MetaPluginClass parent_class; -}; - -GType gnome_shell_plugin_get_type (void); - G_DEFINE_TYPE (GnomeShellPlugin, gnome_shell_plugin, META_TYPE_PLUGIN) static gboolean